#include <iostream>
#include <fstream>

#include "upgma.h"
#include "MultiScoringScheme.h"

//uso il namespace delle classi di Biopool2000
using namespace Biopool;

int main (int argc, char * const argv[]) {

	vector<string> v;
	v.push_back("CCTGTTGTGCTA");
	v.push_back("CTGAGGGAGCTC");
	v.push_back("CCCGGGATCCCC");
	v.push_back("CTAATGTTCCGC");




	ifstream in("D:\\SWAMP\\upgma4victor\\upgma4victor\\blosum62.dat");
	SubMatrix* s = new SubMatrix(in);
	GapFunction* gf = new AGPFunction();
	upgma* u = new upgma(&v, gf, *s);


    UpgmaCluster* c = u->getResult();
	PrintTree(c, cout);

	Biopool::SequenceData* ad = new Biopool::SequenceData(2, v[0], v[1]);


	MultiScoringScheme ss(s, ad, NULL,u->alignments, c, v);
	double score = 0;

		for(int i = 0; i < u->alignments[c->left->sequences[0]].size();i++){
		for(int j = 0; j < u->alignments[c->right->sequences[0]].size();j++){
			score += ss.scoring(i, j);
	}
	}

            //double score = ss.scoring(0, 1);

	cout << "\n\n\nScore:   " << score;
	string x;
	cin >> x;
}
